* {
  margin: 0;
  padding: 0;
}

body {
  background: #232d26;
}

.container {
  width: 400px;
  height: 400px;
  margin: 0 auto;
  margin-top: 50px;
  /* grid 三行 三列 */
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  transition: all 0.3s;
}

@for $i from 0 through 9 {
  .item:nth-child(#{$i + 1}) {
    background: hsl($i * 40%, 100%, 74%);
  }
}

.container:has(.item:nth-child(1):hover) {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 2fr 1fr 1fr;
}
.container:has(.item:nth-child(2):hover) {
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: 2fr 1fr 1fr;
}
.container:has(.item:nth-child(3):hover) {
  grid-template-columns: 1fr 1fr 3fr;
  grid-template-rows: 2fr 1fr 1fr;
}

.container:has(.item:nth-child(4):hover) {
  grid-template-rows: 1fr 2fr 1fr;
  grid-template-columns: 2fr 1fr 1fr;
}
.container:has(.item:nth-child(5):hover) {
  grid-template-rows: 1fr 2fr 1fr;
  grid-template-columns: 1fr 2fr 1fr;
}
.container:has(.item:nth-child(6):hover) {
  grid-template-rows: 1fr 2fr 1fr;
  grid-template-columns: 1fr 1fr 2fr;
}

.container:has(.item:nth-child(7):hover) {
  grid-template-rows: 1fr 1fr 2fr;
  grid-template-columns: 2fr 1fr 1fr;
}
.container:has(.item:nth-child(8):hover) {
  grid-template-rows: 1fr 1fr 2fr;
  grid-template-columns: 1fr 2fr 1fr;
}
.container:has(.item:nth-child(9):hover) {
  grid-template-rows: 1fr 1fr 2fr;
  grid-template-columns: 1fr 1fr 2fr;
}
